/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package virt;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.libvirt.*;

/**
 *
 * @author gravena
 */
public class Main {
    public static void main(String args[]) {
        Connect conn=null;
        try {
            conn = new Connect("qemu:///system");
            int[] listDomains = conn.listDomains();

            conn.getHypervisorVersion(null);
            //conn.domainCreateLinux(VirtualMachineFactory.getVirtualMachineXML(), 0);
            for(int i=0;i<listDomains.length;i++) {
                Domain dom = conn.domainLookupByID(listDomains[i]);
                //dom.suspend();
                //dom.shutdown();
                //dom.destroy();
                System.out.println(dom.getInfo());
            }

        } catch (LibvirtException ex) {
            
        }
    }
}
